home *** CD-ROM | disk | FTP | other *** search
/ Nautilus 1994 April / Nautilus CD Magazine Volume 4-4 April 1994 Windows Edition.mdf / setup / nautcd / link / connect.scr next >
Text File  |  1993-08-18  |  7KB  |  317 lines

  1. !
  2. !  Copyright (c) 1993
  3. !  by CompuServe Incorporated, Columbus, Ohio
  4. !
  5. !  The information in this software is subject to change without
  6. !  notice and should not be construed as a commitment by CompuServe.
  7. !
  8. !  CONNECT:
  9. !    Handles CompuServe and Direct.
  10. !
  11. !  NOTE:  It is recommended that the numeric codes for networks NOT be
  12. !    modified since other utility programs may assume the relationships
  13. !    of network names and network ids specified below.
  14. !
  15. !+V
  16. ! "3.1"
  17. !-V
  18.  
  19. !+N
  20. CompuServe = 1;        ! "CompuServe"
  21. AlaskaNet = 20;        ! "AlaskaNet"
  22. CompuPass = 13;        ! "CompuPass"
  23. CSIRnet = 16;        ! "CSIR-Net"
  24. DataPac = 4;        ! "DataPac"
  25. Datapak = 25;        ! "Datapak (S)"
  26. Datex_J = 19;        ! "Datex-J"
  27. Datex_P = 10;        ! "Datex-P"
  28. FALNET = 14;        ! "FALNET"
  29. FENICSII = 24;        ! "FENICS II"
  30. Dialplus = 11;        ! "GNS Dialplus"
  31. InfoNet_Europe = 5;    ! "InfoNet-Euro"
  32. InfoNet_World = 6;    ! "InfoNet-Wrld"
  33. ISRAKAV = 17;        ! "ISRAKAV"
  34. LATA = 7;        ! "LATA"
  35. CTLATA = 8;        ! "LATA-Ct"
  36. Mercury = 15;        ! "Mercury"
  37. NIF = 12;        ! "NIFTY LL"
  38. PacNet = 21;        ! "PacNet"
  39. Telenet = 2;        ! "SprintNet"
  40. Telepac = 9;        ! "Telepac"
  41. Transpac = 18;        ! "Transpac"
  42. TTNNet = 22;        ! "TTN-Net"
  43. Tymnet = 3;        ! "Tymnet"
  44. VNZNET = 23;        ! "VNZ-Net"
  45. Direct = 26;        ! "Direct"
  46. !-N
  47.  
  48. define %CR = "^M";
  49. define %FALSE = 0;
  50. define %TRUE = 1;
  51. hangup = 1;
  52. UsingModem = %FALSE;
  53. CISNetwork = %FALSE;
  54.  
  55. !
  56. ! Main Program
  57. !
  58. init %Port, %BaudRate;
  59. if %_init goto Continue_Connect;
  60.  
  61. define %FailureMsg = "Could not initialize port";
  62. goto Connect_Fatal;
  63.  
  64. Continue_Connect:
  65.     call %Dir & "first.scr" () : Result;
  66.     if Result = %Cancel goto Cancel_Connect;
  67.     if Result = %Failure goto Connect_Failure;
  68.     if Result = %Fatal goto Connect_Fatal;
  69.  
  70.     on cancel goto Cancel_Connect;
  71.     DirectConnect = (%Network = Direct) or (%DialType = 2);
  72.     if DirectConnect goto Connect_CIS;
  73.  
  74.     call %Dir & "phone.scr" () : Result;
  75.  
  76.     if Result = %Cancel goto Cancel_Connect;
  77.     if Result = %Failure goto Connect_Failure;
  78.     if Result = %Fatal goto Connect_Fatal;
  79.  
  80.     UsingModem = %TRUE;
  81.  
  82.     if %Network = CompuServe goto Connect_CIS;
  83.     if %Network = Telenet goto Connect_Telenet;
  84.     if %Network = Tymnet goto Connect_Tymnet;
  85.     if %Network = DataPac goto Connect_DataPac;
  86.     if %Network = InfoNet_Europe goto Connect_InfoNet_Europe;
  87.     if %Network = InfoNet_World goto Connect_InfoNet_World;
  88.     if %Network = LATA goto Connect_LATA;
  89.     if %Network = CTLATA goto Connect_CTLATA;
  90.     if %Network = Telepac goto Connect_Telepac;
  91.     if %Network = Datex_P goto Connect_Datex_P;
  92.     if %Network = Datex_J goto Connect_Datex_J;
  93.     if %Network = Dialplus goto Connect_Dialplus;
  94.     if %Network = NIF goto Connect_NIF;
  95.     if %Network = CompuPass goto Connect_CompuPass;
  96.     if %Network = FALNET goto Connect_FALNET;
  97.     if %Network = Mercury goto Connect_Mercury;
  98.     if %Network = CSIRnet goto Connect_CSIRnet;
  99.     if %Network = ISRAKAV goto Connect_ISRAKAV;
  100.     if %Network = Transpac goto Connect_Transpac;
  101.     if %Network = AlaskaNet goto Connect_AlaskaNet;
  102.     if %Network = PacNet goto Connect_PacNet;
  103.     if %Network = TTNNet goto Connect_TTNNet;
  104.     if %Network = FENICSII goto Connect_FENICSII;
  105.     if %Network = Datapak goto Connect_Datapak;
  106.     if %Network = VNZNET goto Connect_CIS;
  107.  
  108.     define %FailureMsg = "Network not supported";
  109.     goto Connect_Fatal;
  110.  
  111. !
  112. !  Connect to Telenet
  113. !
  114. Connect_Telenet:
  115.     call %Dir & "telenet.scr" () : Result;
  116.     goto Handle_Network_Return;
  117.  
  118. !
  119. !  Connect to Tymnet
  120. !
  121. Connect_Tymnet:
  122.     call %Dir & "tymnet.scr" (1) : Result;
  123.     goto Handle_Network_Return;
  124.  
  125. !
  126. !  Connect to DataPac
  127. !
  128. Connect_DataPac:
  129.     call %Dir & "datapac.scr" () : Result;
  130.     goto Handle_Network_Return;
  131.  
  132. !
  133. !  Connect to InfoNet Europe
  134. !
  135. Connect_InfoNet_Europe:
  136.     call %Dir & "infonet.scr" (%TRUE) : Result;
  137.     goto Handle_Network_Return;
  138.  
  139. !
  140. !  Connect to InfoNet World
  141. !
  142. Connect_InfoNet_World:
  143.     call %Dir & "infonet.scr" (%FALSE) : Result;
  144.     goto Handle_Network_Return;
  145.  
  146. !
  147. !  Connect to LATA
  148. !
  149. Connect_LATA:
  150.     call %Dir & "lata.scr" (%TRUE) : Result;
  151.     goto Handle_Network_Return;
  152.  
  153. !
  154. !  Connect to Connecticut LATA
  155. !
  156. Connect_CTLATA:
  157.     call %Dir & "lata.scr" (%FALSE) : Result;
  158.     goto Handle_Network_Return;
  159.  
  160. !
  161. !  Connect to Telepac
  162. !
  163. Connect_Telepac:
  164.     call %Dir & "telepac.scr" () : Result;
  165.     goto Handle_Network_Return;
  166.  
  167. !
  168. !  Connect to Datex-P
  169. !
  170. Connect_Datex_P:
  171.     call %Dir & "datexp.scr" () : Result;
  172.     goto Handle_Network_Return;
  173.  
  174. !
  175. !  Connect to Datex-J
  176. !
  177. Connect_Datex_J:
  178.     call %Dir & "datexj.scr" () : Result;
  179.     goto Handle_Network_Return;
  180.  
  181. !
  182. !  Connect to Dialplus
  183. !
  184. Connect_Dialplus:
  185.     call %Dir & "dialplus.scr" () : Result;
  186.     goto Handle_Network_Return;
  187.  
  188. !
  189. !  Connect to NIF
  190. !
  191. Connect_NIF:
  192.     call %Dir & "fenics.scr" (%TRUE) : Result;
  193.     goto Handle_Network_Return;
  194.  
  195. !
  196. !  Connect to CompuPass
  197. !
  198. Connect_CompuPass:
  199.     call %Dir & "fenics.scr" (%FALSE) : Result;
  200.     goto Handle_Network_Return;
  201.  
  202. !
  203. !  Connect to FALNET
  204. !
  205. Connect_FALNET:
  206.     call %Dir & "falnet.scr" (%FALSE) : Result;
  207.     goto Handle_Network_Return;
  208.  
  209. !
  210. !  Connect to Mercury
  211. !
  212. Connect_Mercury:
  213.     call %Dir & "mercury.scr" () : Result;
  214.     goto Handle_Network_Return;
  215.  
  216. !
  217. !  Connect to CSIR-Net
  218. !
  219. Connect_CSIRnet:
  220.     call %Dir & "csirnet.scr" () : Result;
  221.     goto Handle_Network_Return;
  222.  
  223. !
  224. !  Connect to ISRAKAV
  225. !
  226. Connect_ISRAKAV:
  227.     call %Dir & "israkav.scr" () : Result;
  228.     goto Handle_Network_Return;
  229.  
  230. !
  231. !  Connect to Transpac
  232. !
  233. Connect_Transpac:
  234.     call %Dir & "transpac.scr" () : Result;
  235.     goto Handle_Network_Return;
  236.  
  237. !
  238. !  Connect to AlaskaNet
  239. !
  240. Connect_AlaskaNet:
  241.     call %Dir & "tymnet.scr" (2) : Result;
  242.     goto Handle_Network_Return;
  243.  
  244. !
  245. !  Connect to PacNet
  246. !
  247. Connect_PacNet:
  248.     call %Dir & "tymnet.scr" (3) : Result;
  249.     goto Handle_Network_Return;
  250.  
  251. !
  252. !  Connect to TTN-Net
  253. !
  254. Connect_TTNNet:
  255.     call %Dir & "ttnnet.scr" (3) : Result;
  256.     goto Handle_Network_Return;
  257.  
  258. !
  259. !  Connect to FENICS II
  260. !
  261. Connect_FENICSII:
  262.     call %Dir & "fenics2.scr" (3) : Result;
  263.     goto Handle_Network_Return;
  264.  
  265. !
  266. !  Connect to Datapak
  267. !
  268. Connect_Datapak:
  269.     call %Dir & "datapak.scr" (3) : Result;
  270.     goto Handle_Network_Return;
  271.  
  272. !
  273. !  Handle Network Return
  274. !
  275. Handle_Network_Return:
  276.     if Result = %Success goto Do_CIS_Script;
  277.     if Result = %Cancel goto Cancel_Connect;
  278.     if Result = %Fatal goto Connect_Fatal;
  279.     goto Connect_Failure;
  280.  
  281. !
  282. !  Connect to CIS
  283. !
  284. Connect_CIS:
  285.     CISNetwork = %TRUE;
  286.     send %CR;
  287.  
  288. Do_CIS_Script:
  289.     call %Dir & "cserve.scr" (DirectConnect, CISNetwork) : Result;
  290.     if Result = %Failure goto Connect_Failure;
  291.     if Result = %Cancel goto Cancel_Connect;
  292.     if Result = %Fatal goto Connect_Fatal;
  293.     exit %Success;
  294.  
  295. Connect_Failure:
  296.     gosub Hangup_Connect;
  297.     reset;
  298.     exit %Failure;
  299.  
  300. Connect_Fatal:
  301.     gosub Hangup_Connect;
  302.     reset;
  303.     exit %Fatal;
  304.  
  305. Hangup_Connect:
  306.     if not UsingModem goto Hangup_Done;
  307.     ifndef %LOCAL = 1;
  308.     call %Dir & "disconct.scr" ();
  309. Hangup_Done:
  310.     return;
  311.  
  312. Cancel_Connect:
  313.     show "Connect cancelled";
  314.     gosub Hangup_Connect;
  315.     reset;
  316.     exit %Cancel;
  317.